package com.cd826dong.clouddemo.provider.api;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class ProviderEndPoint {

    @Value("${server.port}")
    private String servicePort;

    @Value("${encry.test.content}")
    private String encryTestConten;

    @RequestMapping(value = "/{name}", method = RequestMethod.GET)
    public String hello(@PathVariable String name){
        return "hello," + name + ",from:" + servicePort + ",encry:" + encryTestConten;
    }
    
    @RequestMapping(value = "/rand/num", method = RequestMethod.GET)
    public String randNum(){
        return System.currentTimeMillis() + "";
    }
    
}
